/* ==================
          边框
 ==================== */

/* -- 实线 -- */
.border {
  overflow: initial !important;
  @at-root [class*='border'],
    [class*='dashed'] {
    position: relative;
    &.dline {
      --vin-border: var(--vin-bg-3);
    }
    &::after {
      position: absolute;
      top: 0;
      left: 0;
      z-index: 0;
      box-sizing: border-box;
      width: 200%;
      height: 200%;
      border-radius: inherit;
      transform: scale(0.5);
      transform-origin: 0 0;
      content: ' ';
      pointer-events: none;
    }
    &.radius::after {
      border-radius: calc(#{$radius} * 2);
    }
    &.round::after {
      border-radius: #{$round-pill};
    }
  }
  &::after {
    border: 1px solid var(--vin-border);
  }
  &s::after {
    border: 2px solid var(--vin-border);
  }
  &ss::after {
    border: 4px solid var(--vin-border);
  }
  @each $value in (top, right, bottom, left) {
    &-#{$value}::after {
      border-#{$value}: 1px solid var(--vin-border);
    }
    &s-#{$value}::after {
      border-#{$value}: 2px solid var(--vin-border);
    }
    &ss-#{$value}::after {
      border-#{$value}: 4px solid var(--vin-border);
    }
  }
}

/* -- 虚线 -- */
.dashed {
  &::after {
    border: 2px dashed var(--vin-border);
  }
  &s::after {
    border: 3px dashed var(--vin-border);
  }
  @each $value in (top, right, bottom, left) {
    &-#{$value}::after {
      border-#{$value}: 2px dashed var(--vin-border);
    }
    &s-#{$value}::after {
      border-#{$value}: 3px dashed var(--vin-border);
    }
  }
}
@each $color, $value in map-merge($colors, map-merge($darks, $grays)) {
  .border-#{$color}::after,
  .border-#{$color}[class*='-shine']::before {
    border-color: $value !important;
  }
}
@each $value in (a, b, c, d, e) {
  .main-#{$value}-border::after,
  .main-#{$value}-border[class*='-shine']::before {
    border-color: var(--main-#{$value}) !important;
  }
}
.dashed-shine,
.dasheds-shine {
  position: relative;
  overflow: hidden;
  &::after,
  &::before {
    width: calc(200% + 40px);
    height: 200%;
    border-color: var(--vin-border);
    border-style: dashed;
    border-width: 2px 0;
    animation: shineafter 1s infinite linear;
  }
  &::before {
    position: absolute;
    box-sizing: border-box;
    width: 200%;
    height: calc(200% + 40px);
    border-width: 0 2px;
    transform: scale(0.5);
    transform-origin: 0 0;
    animation: shinebefore 1s infinite linear;
    content: ' ';
    pointer-events: none;
  }
}
.dasheds-shine {
  &::after,
  &::before {
    border-width: 4px 0;
  }
  &::before {
    border-width: 0 4px;
  }
}

@keyframes shineafter {
  0% {
    top: 0;
    left: -22px;
  }
  100% {
    top: 0;
    left: 0;
  }
}

@keyframes shinebefore {
  0% {
    top: -22px;
    left: 0;
  }
  100% {
    top: 0;
    left: 0;
  }
}
